#ifndef _MM_CONFIG_H
#define _MM_CONFIG_H

extern uint8_t *g_vis_buffer[];


#if 0//AR0230_1080P_ENABLE
#define MM_IMG_SIZE_RGB   (1280*720*4)       /** 1280 * 720 * 2 = 1.8M */ 
#else
#define MM_IMG_SIZE_RGB   640*360*4        /** 640 * 360 * 4 = 900K */ 
#endif

#define MM_IMG_SIZE_IR      (640*360*1)        /** 640 * 360 = 225K */ 
#define MM_IMG_SIZE_SPK     (640*360*1)        /** 640 * 360 = 225K */ 


/** memory for image */
#define  MM_IMG_ADDR_BASE  0x0         /** 640 * 360 * 4 = 900K */ 
#define  MM_IMG_FOR_DPU    MM_IMG_ADDR_BASE   /** 320 * 240 * 2 = */ 

#define  MM_CAMER_ADDR_BASE 0x0

/* isp */
#define  MM_IMG_ISP0_SIZE  MM_IMG_SIZE_IR
#define  MM_IMG_ISP1_SIZE  MM_IMG_SIZE_RGB
#define  MM_IMG_ISP2_SIZE  MM_IMG_SIZE_SPK                      //NO USE

#define  MM_IMG_ISP0_BUF0  MM_CAMER_ADDR_BASE         
#define  MM_IMG_ISP0_BUF1  MM_IMG_ISP0_BUF0         
// #define  MM_IMG_ISP1_BUF0  MM_IMG_ISP0_BUF1 + MM_IMG_ISP0_SIZE        
// #define  MM_IMG_ISP1_BUF1  MM_IMG_ISP1_BUF0 + MM_IMG_ISP1_SIZE      
// #define  MM_IMG_ISP1_BUF2  MM_IMG_ISP1_BUF1 + MM_IMG_ISP1_SIZE    
#define  MM_IMG_ISP1_BUF0  0//MM_IMG_ISP0_BUF1 + MM_IMG_ISP0_SIZE     
#define  MM_IMG_ISP1_BUF1  0//MM_IMG_ISP1_BUF0   
#define  MM_IMG_ISP1_BUF2  0//MM_IMG_ISP1_BUF1 

// #define MM_IMAGE_DPU_BUF0  MM_IMG_ISP1_BUF0
// #define MM_IMAGE_DPU_BUF1  MM_IMG_ISP1_BUF1
// #define MM_IMAGE_DPU_BUF2  MM_IMG_ISP1_BUF2

#define MM_IMAGE_DPU_BUF0  g_vis_buffer[0]
#define MM_IMAGE_DPU_BUF1  g_vis_buffer[1]
#define MM_IMAGE_DPU_BUF2  g_vis_buffer[2]


// #define  MM_IMG_ISP2_BUF0  MM_IMG_ISP1_BUF2 + MM_IMG_ISP1_SIZE  //NO USE
// #define  MM_IMG_ISP2_BUF1  MM_IMG_ISP2_BUF0 + MM_IMG_ISP2_SIZE  //NO USE
#define  MM_IMG_ISP2_BUF0  MM_IMG_ISP1_BUF2 
#define  MM_IMG_ISP2_BUF1  MM_IMG_ISP2_BUF0

#define  MM_IMG_RGB_BUF0  MM_IMG_ISP1_BUF0
#define  MM_IMG_RGB_BUF1  MM_IMG_ISP1_BUF1
#define  MM_IMG_IR_BUF0   MM_IMG_ISP0_BUF0
#define  MM_IMG_IR_BUF1   MM_IMG_ISP0_BUF1
#define  MM_IMG_SPK_BUF0  MM_IMG_ISP0_BUF1
#define  MM_IMG_SPK_BUF1  MM_IMG_ISP0_BUF2

#if 0
#define  MM_IMG_RGB_FROM_UART (MM_IMG_ISP2_BUF1 + MM_IMG_ISP2_SIZE)  //640*360*4
//test hist use
#define  MM_IR_TEST_BUF    (MM_IMG_RGB_FROM_UART + MM_IMG_SIZE_RGB)  //#define  MM_IR_TEST_BUF    0x07D00000 

#define MM_USB_BUF_IR     (MM_IR_TEST_BUF + MM_IMG_SIZE_RGB)
#define MM_USB_BUF_SPK    (MM_USB_BUF_IR + MM_IMG_SIZE_IR)
#define MM_USB_BUF_RGB    (MM_USB_BUF_IR + MM_IMG_SIZE_SPK)

#define IR_BUF_ADR_DIS    (MM_USB_BUF_RGB + MM_IMG_SIZE_RGB)
#define MM_MIPI2DMA_BUF1  MM_IMG_ISP1_BUF0         /** 1280 * 720 * 2 = 1.8M (0x1c2000)*/ 

#define  MM_IMG_ADDR_END   0x07000000         /** 1280 * 720 * 2 = 3.6M (0x384000) */
/** memory for image end*/

//user define : dpu
#define IR_BUF_ADR   	    IR_BUF_ADR_DIS //MM_IMG_IR_BUF0                      //Original picture
#define ABGR_BUF_ADR   	    (MM_IMG_RGB_BUF0+140*360*4+60*4)      //Original picture
#define	DST_ADR        		0x1000000     //show  

/*  */
#define  REFACE_NUM_ADR 		       (uint32_t *)0x7e00000
//#define  FACE_ID_ADR 		           (uint32_t *)0x7e00004
//#define  FACE_FEATURE_ADR 	           (uint8_t *)0x7e00008

#else
#define  MM_IMG_RGB_FROM_UART MM_IMG_ISP0_SIZE
//test hist use
#define  MM_IR_TEST_BUF    MM_IMG_ISP0_SIZE  //#define  MM_IR_TEST_BUF    0x07D00000 

#define MM_USB_BUF_IR     MM_IMG_ISP0_SIZE
#define MM_USB_BUF_SPK    MM_IMG_ISP0_SIZE
#define MM_USB_BUF_RGB    MM_IMG_ISP0_SIZE

#define IR_BUF_ADR_DIS    MM_IMG_ISP0_SIZE
#define MM_MIPI2DMA_BUF1  MM_IMAGE_DPU_BUF0//MM_IMG_ISP0_SIZE        

/** memory for image end*/

//user define : dpu
#define IR_BUF_ADR   	    MM_IMG_ISP0_SIZE //MM_IMG_IR_BUF0                      //Original picture
#define ABGR_BUF_ADR   	    MM_IMG_ISP0_SIZE      //Original picture
#define	DST_ADR        		MM_IMG_ISP0_SIZE    //show  

#define  REFACE_NUM_ADR     (uint32_t *)0x0D00000
#endif
 
#if 0
/** memory for AIE */
#define  MM_AI_DATA_ADDR_BASE  0x07000000 
#define  MM_AI_WEIGHT_ADDR     MM_AI_DATA_ADDR_BASE  /* weight data (10M) */
#define  MM_AI_3DPARAM_ADDR    0x07A00000            /* 3D data (3M) */
#define  MM_AI_RELOAD_IN_ADDR  0x07D00000            /* Reload data in(500K) */
#define  MM_AI_RELOAD_OUT_ADDR 0x07D80000            /* Reload data out(500k) */
#define  MM_AI_FACE_DATA_ADDR  0x07E00000            /* face feature(348 X 2 X 30) */
#define  MM_AI_DATA_ADDR_END   0x08000000      
#endif

#endif
